package com.dhcc.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dhcc.entity.SysInstitution;
import com.dhcc.entity.SysInstitutionRole;
import com.dhcc.httpApiService.IdGeneratorService;
import com.dhcc.mapper.SysInstitutionMapper;
import com.dhcc.service.ClientUserService;
import com.dhcc.service.SysInstitutionService;
import com.dhcc.utils.AuthUtil;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;

@Service
public class SysInstitutionServiceImpl extends ServiceImpl<SysInstitutionMapper, SysInstitution> implements SysInstitutionService {
    @Resource
    private SysInstitutionMapper sysInstitutionMapper;
    @Resource
    private IdGeneratorService idGeneratorService;
    @Resource
    private ClientUserService clientUserService;
    @Override
    public SysInstitution selectInstitutionById(String institutionId) {
        SysInstitution sysInstitution=sysInstitutionMapper.selectInstitutionById(institutionId);
        return sysInstitution;
    }

    @Override
    public List<SysInstitution> selectChildInstitutionList(String institutionId) {
        return sysInstitutionMapper.selectChildInstitutionList(institutionId);
    }

    @Override
    public Integer addInstitution(SysInstitution sysInstitution) {
        //在机构表添加对应数据
        return sysInstitutionMapper.addInstitution(sysInstitution);
    }

    @Override
    public Integer updateInstitution(SysInstitution sysInstitution) {
        return sysInstitutionMapper.updateInstitution(sysInstitution);
    }

    @Override
    public List<SysInstitutionRole> getAllInstitutionRole() {
        return sysInstitutionMapper.getAllInstitutionRole();
    }

    @Override
    public Integer deleteInstitution(String institutionId) {
        return sysInstitutionMapper.deleteInstitution(institutionId);
    }
}
